#include "StdAfx.h"
#include "UISpinControl.h"
#include "UIGlobalStyle.h"
#include "UIDrawTool.h"

CUISpinControl::CUISpinControl( HWND hWnd ): CUIControl( hWnd )
{
}


CUISpinControl::~CUISpinControl( void )
{
}


void CUISpinControl::OnDraw( HDC hDC )
{
    RECT rcItem = {0};
    GetButtonRect( rcItem );

    COLORREF clr = IsEnable() ? CUIGlobalStyle::GetEdgeLightColor() : CUIGlobalStyle::GetEdgeDkShadowColor();
    CUIDrawTool::FillSolidRect( hDC, rcItem, clr );

    TCHAR sText[MAX_PATH] = {0};
    int len =::GetWindowText( GetHwnd(), sText, MAX_PATH );
    ::SetBkMode( hDC, TRANSPARENT );
    ::DrawText( hDC, sText, len, &rcItem, DT_SINGLELINE | DT_VCENTER | DT_CENTER );
}

LRESULT CUISpinControl::ProcessUIMsg( UINT uMsg, WPARAM wParam, LPARAM lParam )
{
    return CUIControl::ProcessUIMsg( uMsg, wParam, lParam );
}

